"""Audit log Pydantic schemas."""

from __future__ import annotations

from typing import Any

from pydantic import Field

from ..schemas.base import ORMBase, TimestampModel


class AuditLogBase(ORMBase):
    """Base AuditLog schema."""

    action: str = Field(..., min_length=1, max_length=100)
    payload_digest: str | None = None
    extra_data: dict[str, Any] | None = None


class AuditLogCreate(AuditLogBase):
    """Schema for creating an audit log entry."""

    actor_id: int


class AuditLogOut(AuditLogBase, TimestampModel):
    """Schema for audit log output."""

    id: int
    actor_id: int
